%% this shows the mean PSNR,and iteration
% clc; clear;
% close all;
% data_path = srpath.getDataPath;

% scale = 3;
% ModelIters = 100;

% if strcmp(mycaffe.get_caller, 'demo')
%     return
% end

%%
% ImgSet = 'Set14';
ImgSet = 'Set5';
% ImgSet = 'General100';
% ImgSet = 'B100';

%% FSRCNN_VDSR_Scale2
scale = 2;
result_path = fullfile(fileparts(srpath.getResultPath), '%FSRCNN-VDSR(MSRA)-Scale(2)');
% mynet.name = 'VDSR_y-1';
mynet.name = 'VDSR_y1';
% models_folder = 'models';
models_folder = 'models_warmweights';

mynet.model_path = fullfile(result_path, mynet.name, models_folder);
mynet.deploy_file = fullfile(result_path, mynet.name, 'VDSR_y_deploy.prototxt');
mynet.model_prefix = 'VDSR_y_iter_';

%%
[psnrs, ssims, ImgList] = sranaly.analySRQuality(ImgSet, [], scale, 'FSRCNN');

ModelIters = [];
% ModelIters = [70000 Inf];
[psnrs2, ssims2] = sranaly.analyImgQuality(ImgList(:, end), ImgList(:, 1), scale, mynet, ModelIters);

V.F.VDSR3.Set5.PSNR = psnrs2;
V.F.VDSR3.Set5.SSIM = ssims2;

%% VDSR0_VDSR_Scale4
scale = 4;
result_path = fullfile(srpath.getResultPath('VDSR0-VDSR-Scale(4)'));
mynet.name = 'VDSR_y1';
models_folder = 'models';
% models_folder = 'models_VDSR3';

% result_path = srpath.getResultPath('myresult');

%%
% model_files = mycaffe.getModelFiles(mynet.model_path, mynet.model_prefix, ModelIters);
% caffemodel = fullfile(mynet.model_path, model_files{end});
% hDeploy = @(x) mycaffe.caffe(x, mynet.deploy_file, caffemodel, 'test');

% srmodel.showSRImages(ImgSet, scale, mynet.name, hDeploy);


